// Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
// This source file is part of the Cangjie project, licensed under Apache-2.0
// with Runtime Library Exception.
//
// See https://cangjie-lang.cn/pages/LICENSE for license information.

#ifndef CANGJIE_MIGRATOR_RULES_ACTION_RULE
#define CANGJIE_MIGRATOR_RULES_ACTION_RULE

#include <string>

#include "Actions/Action.h"
#include "Rules/ExtractedInfo.h"
#include "UpdateInstance.h"
#include "TomlFile.h"

namespace CangjieMigrator::Rules {

class ActionRule {
public:
    explicit ActionRule(const TomlConfig &config);

    [[nodiscard]] std::vector<Actions::Action> GenerateAction(UpdateInstance::File &file, const ExtractedInfo &info, const Rule &rule) const;

    [[nodiscard]] std::string ToString() const;

private:
    std::string replace;
    std::string comment;
};

} // namespace CangjieMigrator::Rules

#endif // CANGJIE_MIGRATOR_RULES_ACTION_RULE